package com.xucan.pdf;

public class DiscountContext {

    /** 策略类 */
    private DiscountStrategy strategy;

    public DiscountContext(DiscountStrategy strategy) {
        this.strategy = strategy;
    }

    /**
     * 应用打折
     * @param originalPrice
     * @return
     */
    public double applyDiscount(double originalPrice) {
        return strategy.calculateDiscountPrice(originalPrice);
    }
}